import React, { useEffect } from 'react';
import * as echarts from 'echarts/core';
import { GridComponent } from 'echarts/components';
import { LineChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';

echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);
export default function Renmen_right() {
  useEffect(() => {
    const chartDom = document.getElementById('Renmen_right');
    const myChart = echarts.init(chartDom);

    const option = {
      xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      },
      yAxis: {
        type: 'value',
      },
      series: [
        {
          data: [30,25,89,63,45,73,65],
          type: 'line',
          areaStyle: {},
        },
      ],
    };

    option && myChart.setOption(option);
    window.onresize = function () {
      myChart.resize();
    };
  }, []);
  return (
    <div id="Renmen_right" style={{ width: '100%', height: '1.5rem' }}></div>
  );
}
